<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="/pages/protected/templates/master.xhtml">
		<ui:define name="divMain">
			<h:form id="registrosForm" prependId="false">
				<p:dataTable id="registrosTable"
					value="#{registroMB.todosRegistros}" var="registro"
					emptyMessage="#{bundle.noRecords}" paginator="true" rows="10"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="5,10,15">
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.numeroRegistro}" />
						</f:facet>
						<h:outputText value="#{registro.numero}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.dataRegistro}" />
						</f:facet>
						<h:outputText value="#{registro.dataHora}">
							<f:convertDateTime pattern="dd/MM/yyyy" type="date" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{bundle.horaRegistro}" />
						</f:facet>
						<h:outputText value="#{registro.dataHora}">
							<f:convertDateTime pattern="HH:mm:ss" type="date" />
						</h:outputText>
					</p:column>
				</p:dataTable>
					
				<p:commandButton value="#{bundle.buscar} #{bundle.registro}"
					icon="ui-icon-plus" update=":registroBuscarDialogForm"
					onclick="registroBuscarDialogWidget.show();" 
					actionListener="#{registroMB.buscarRegistros()}"/>

				<p:growl id="messages" showDetail="true" />
			</h:form>
			<ui:include
				src="/pages/protected/admin/dialogs/registroBuscarDialog.xhtml" />
			<ui:include
				src="/pages/protected/admin/dialogs/registroDeletarDialog.xhtml" />
		</ui:define>
	</ui:composition>
</h:body>
</html>

<!-- <p:commandButton value="#{bundle.create} #{bundle.registro}"
	icon="ui-icon-plus" update=":registroCriarDialogForm"
	actionListener="#{registroMB.resetRegistro()}"
	onclick="registroCriarDialogWidget.show();" /> -->
	
<!-- <p:column>
		<p:commandButton value="#{bundle.update}" icon="ui-icon-pencil"
			update=":registroAtualizarDialogForm"
			onclick="registroAtualizarDialogWidget.show();">
			<f:setPropertyActionListener target="#{registroMB.registro}"
				value="#{registro}" />
		</p:commandButton>
		<p:spacer width="10px" />
		<p:commandButton value="#{bundle.delete}" icon="ui-icon-trash"
			update=":registroDeletarDialogForm"
			onclick="registroDeletarDialogWidget.show();">
			<f:setPropertyActionListener target="#{registroMB.registro}"
				value="#{registro}" />
		</p:commandButton>
	</p:column> -->
	
<!-- <p:fileUpload styleClass="menuButton"
	fileUploadListener="#{fileUploadController.handleFileUpload}"
	mode="advanced" update=":messageGrowl :registrosForm:registrosTable"
	auto="false" sizeLimit="100000" allowTypes="/(\.|\/)(txt)$/" /> -->
	
<!-- <ui:include
	src="/pages/protected/admin/dialogs/registroAtualizarDialog.xhtml" /> -->